package trinnes.oliver.unimaas.smartpentalath.intelligence.features;

import trinnes.oliver.unimaas.smartpentalath.control.Game;
import trinnes.oliver.unimaas.smartpentalath.data.Move;

/**
 *
 * @author Oliver Trinnes
 */
public class FourWithFreedomFeature extends Feature
{

  public FourWithFreedomFeature(int weight)
  {
    super(weight);
  }

  @Override
  public int getValue(Game game, int move)
  {
    if (move == Move.SWAP)
      return 0;
    if(game.getBoard().isInARowWithFreedom(move, game.getCurrentPlayer().getPiece(), 4))
      return 1;
    return 0;
  }

}
